//
//  TZLivenessEnumType.h
//  MGLivenessDetection
//
//  Created by tom on 15/03/2018.
//  Copyright © 2018 megvii. All rights reserved.
//

#ifndef TZLivenessEnumType_h
#define TZLivenessEnumType_h


#endif /* TZLivenessEnumType_h */


#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#define NWD_LANDMARK_POINTS_NUM 5
#define NWD_FACE_RECT_NUM 4
#define NWD_MAX_COUNT 10

//typedef enum MGLivenessDetectionType {
//    DETECTION_TYPE_NONE = 0,                ///<初始状态
//    DETECTION_TYPE_BLINK = 1,               ///<眨眼
//    DETECTION_TYPE_MOUTH = 2,               ///<张嘴
//    DETECTION_TYPE_POS_YAW = 3,             ///<左右转头
//    DETECTION_TYPE_POS_PITCH = 4,           ///<上下点头
//    DETECTION_TYPE_POS_YAW_LEFT = 5,        ///<向左转头
//    DETECTION_TYPE_POS_YAW_RIGHT = 6,       ///<向右转头
//    DETECTION_TYPE_POS_PITCH_UP = 7,        ///<抬头
//    DETECTION_TYPE_POS_PITCH_DOWN = 8,      ///<低头
//    DETECTION_TYPE_DONE = 9,                ///<结束状态
//    DETECTION_TYPE_AIMLESS = -1             ///<持续监测
//} MGLivenessDetectionType;


typedef enum NWDLiveType {

    LIVE_TYPE_EYE           =   0,                ///眨眼
    LIVE_TYPE_MOUTH         =   1,                ///张嘴闭嘴
    LIVE_TYPE_SHAKE_HEAD    =   2,                ///摇头
    LIVE_TYPE_NOD_HEAD      =   3,                ///点头

} NWDLiveType;

typedef struct _return_face_rect{
    NSInteger face_count;

    //张嘴闭嘴  close:0,open:1
    NSInteger mouse_flag;

    //close:0,open:1
    NSInteger eye_flag;

    //左眼睁闭情况 close:0,open:1
    NSInteger left_eye_flag;

    //右眼睁闭情况 close:0,open:1
    NSInteger right_eye_flag;

    //摇头 middle:0, left：1，right：2
    NSInteger head_shake_flag;

    //点头 middle:0, up：2，down：1
    NSInteger head_nod_flag;

    //0(legal face)/-1(no face)
    NSInteger state;

    //1(near)/0(middle)/2(far)
    NSInteger face_pos_state;

    float x1;
    float y1;
    float x2;
    float y2;
    float area_ratio;
    float NWDLandmarks[NWD_MAX_COUNT];
    float NWDBboxes[NWD_FACE_RECT_NUM];

}return_face_rect;

